/**
 * Project Name:spring-cloud-pilot File Name:SecondListener.java Package Name:org.spring.cloud.pilot.listener
 * Date:2019年10月23日下午4:35:44 Copyright (c) 2019, dengqian37@126.com All Rights Reserved.
 *
 */

package org.spring.cloud.pilot.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.spring.cloud.pilot.filewatch.FileSystemWatcher;
import org.spring.cloud.pilot.jar.ClassPathFileChangeListener;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.util.Assert;

/**
 * ClassName:SecondListener <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON. <br/>
 * Date: 2019年10月23日 下午4:35:44 <br/>
 * 
 * @author dengqian
 * @version
 * @since JDK 1.8
 * @see
 */
public class SecondListener implements ServletContextListener {

    private  ApplicationEventPublisher eventPublisher;
    
    public SecondListener(ApplicationEventPublisher eventPublisher){
        Assert.notNull(eventPublisher, "EventPublisher must not be null");
        this.eventPublisher = eventPublisher;
    }
    
    @Override
    public void contextInitialized(ServletContextEvent sce) {
//        FileSystemWatcher watcher = new FileSystemWatcher(false,3000,500);
//        watcher.addListener(new ClassPathFileChangeListener(eventPublisher));
//        watcher.start();
        
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {


    }

}
